from django.contrib import admin
from .models import WasteClassification, UserSubmission


@admin.register(WasteClassification)
class WasteClassificationAdmin(admin.ModelAdmin):
    """垃圾分类信息管理"""
    list_display = ['waste_id', 'item_name', 'category', 'city', 'description']
    list_filter = ['category', 'city']
    search_fields = ['item_name', 'city']


@admin.register(UserSubmission)
class UserSubmissionAdmin(admin.ModelAdmin):
    """用户纠错提交管理"""
    list_display = ['submission_id', 'user', 'term', 'ai_temp_answer', 'status', 'created_at']
    list_filter = ['status', 'created_at']
    search_fields = ['user__id', 'term']
    ordering = ['-created_at']
